#pragma once
#include "memory.h"

class CMsgAllocater:public CMemory
{
private:
	struct block*		ptr_block;
	int					alloc_pos;
	CLocker				data_lock;
public:
	CMsgAllocater(IMemoryStrategy* strategy);

	~CMsgAllocater();

	struct msg*	alloc_sized_msg(uint32 size);

	list_t<struct msg*> copy_msg(struct msg*,int count);
private:
	void adjust(uint32 require_size);
};

extern CMsgAllocater* theAllocater;